<html>
<head>
    <title>审核愿望</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js">
    </script>
    <script>
    $(document).ready(function(){
        $('input:checkbox').click(function() {
            var tid = $(this).attr("tid");
            $.post("/approve/todo",
                {
                    tid: tid, 
                },
                function(data, status) {
                    if (status == "success") {
                        location.href="/approve/list";
                    } else {
                        alert(status)
                        return;
                    }
                }
            )
            .error(function() { 
                alert("未完成，请刷新后重试。"); 
            });
        });
    });
    </script>
</head>
<body>
    <div align="center">
        <h2>
            待审核愿望清单
        </h2>
        <a href="/">回首页</a>
        <hr>
        {{range .todos}}
        <p><big><input type="checkbox" tid="{{.ID}}"> {{.UserID}} : {{.Desc}} </big></p>
        <hr>
        {{end}}
    </div>
</body>
</html>